unit RenameCanvas;

interface

uses
  Database,
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TFormRenameCanvas = class(TForm)
    Label1: TLabel;
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    EditCaption: TEdit;
    procedure BtnCancelClick(Sender: TObject);
    procedure BtnOKClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure EditCaptionKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
    cap: string;
  end;

var
  FormRenameCanvas: TFormRenameCanvas;

implementation

{$R *.DFM}

procedure TFormRenameCanvas.FormCreate(Sender: TObject);
begin
  cap:='<nIl>';
end;

procedure TFormRenameCanvas.BtnCancelClick(Sender: TObject);
begin
  cap:='<nIl>';
  close;
end;

procedure TFormRenameCanvas.EditCaptionKeyPress(Sender: TObject;
  var Key: Char);
begin
  if key = #13 then begin
    BtnOK.click;
    key:=#0;
  end;
end;

procedure TFormRenameCanvas.BtnOKClick(Sender: TObject);
begin
  cap:=EditCaption.text;
  close;
end;

end.
